function E(el) {
	var a = document.querySelectorAll(el);
	if(a.length > 1) {
		return a;
	} else {
		return a[0];
	}
};
//导航内容开始
for(var i = 0, len = E("#rexiaotj>ul>li").length; i < len; i++) {
	E("#rexiaotj>ul>li")[i].index = i
	E("#rexiaotj>ul>li")[i].addEventListener("click", function() {
		E("#rexiaotj>ul>li")[0].style.background = "transparent";
		E("#rexiaotj>ul>p").style.transition = "all 0.3s linear";
		E("#rexiaotj>ul>p").style.left = 2.8 * this.index + "rem";
	}, false)
}
//导航内容结束

//导航拖拽开始
var lastX = 0,
	ood = 0,
	odl = 0;
E("#rexiaotj").addEventListener("touchstart", function(e) {
	lastX = 0;
	ood = e.touches[0].clientX;
}, false);
E("#rexiaotj").addEventListener("touchmove", function(e) {
	lastX = e.touches[0].clientX;
	ab = lastX - ood;
	E("#rexiaotj>ul").style.left = ab + odl + "px"
	if(E("#rexiaotj>ul").offsetLeft > 0) {
		E("#rexiaotj>ul").style.left = 0
		odl = 0
	}
	if(E("#rexiaotj>ul").offsetLeft < -(E("#rexiaotj>ul").offsetWidth - E(".rementuijian").offsetWidth - 4)) {
		E("#rexiaotj>ul").style.left = -(E("#rexiaotj>ul").offsetWidth - E(".rementuijian").offsetWidth - 4) + 'px'
		odl = -(E("#rexiaotj>ul").offsetWidth - E(".rementuijian").offsetWidth - 4)
	}
	//	console.log(E(".rementuijian>aside>ul").offsetWidth - E(".rementuijian").offsetWidth)
}, false);
E("#rexiaotj").addEventListener("touchend", function(e) {
		odl = E("#rexiaotj>ul").offsetLeft;
	}, false)
	//导航拖拽结束

//惠生活拖拽开始
var lastX1 = 0,
	ood1 = 0,
	odl1 = 0;
E(".huishenghuo>bottom").addEventListener("touchstart", function(e) {
	lastX1 = 0;
	ood1 = e.touches[0].clientX;
}, false);
E(".huishenghuo>bottom").addEventListener("touchmove", function(e) {
	lastX1 = e.touches[0].clientX;
	ab1 = lastX1 - ood1;
	E(".huishenghuo>bottom>ul").style.left = ab1 + odl1 + "px"
	if(E(".huishenghuo>bottom>ul").offsetLeft > 0) {
		E(".huishenghuo>bottom>ul").style.left = 0;
		odl1 = 0
	}
	if(E(".huishenghuo>bottom>ul").offsetLeft < -E(".huishenghuo").offsetWidth) {
		E(".huishenghuo>bottom>ul").style.left = -E(".huishenghuo").offsetWidth + "px";
		odl1 = -E(".huishenghuo").offsetWidth;
	}
}, false);
E(".huishenghuo>bottom").addEventListener("touchend", function(e) {
		odl1 = E(".huishenghuo>bottom>ul").offsetLeft;
	}, false)
	//惠生活拖拽结束